package com.hundredapp.oa.domain;

import static javax.persistence.GenerationType.IDENTITY;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * OaReserve entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "oa_reserve", catalog = "oa_demo")
public class OaReserve implements java.io.Serializable {

	// Fields

	private Integer id;
	private OaUser oaUser;
	private OaSecuit oaSecuit;
	private String phone;
	private Timestamp reserveTime;
	private Integer createUserId;
	private Timestamp createTime;
	private List<OaReturnVisit> oaReturnVisits = new ArrayList<OaReturnVisit>(0);

	// Constructors

	/** default constructor */
	public OaReserve() {
	}
	
	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public OaUser getOaUser() {
		return this.oaUser;
	}

	public void setOaUser(OaUser oaUser) {
		this.oaUser = oaUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "secuit_id")
	public OaSecuit getOaSecuit() {
		return this.oaSecuit;
	}

	public void setOaSecuit(OaSecuit oaSecuit) {
		this.oaSecuit = oaSecuit;
	}

	@Column(name = "phone", length = 45)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "reserve_time", length = 19)
	public Timestamp getReserveTime() {
		return this.reserveTime;
	}

	public void setReserveTime(Timestamp reserveTime) {
		this.reserveTime = reserveTime;
	}

	@Column(name = "create_user_id")
	public Integer getCreateUserId() {
		return this.createUserId;
	}

	public void setCreateUserId(Integer createUserId) {
		this.createUserId = createUserId;
	}

	@Column(name = "create_time", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@OneToMany(cascade = {CascadeType.REFRESH,CascadeType.MERGE,CascadeType.PERSIST}, fetch = FetchType.LAZY, mappedBy = "oaReserve")
	public List<OaReturnVisit> getOaReturnVisits() {
		return this.oaReturnVisits;
	}

	public void setOaReturnVisits(List<OaReturnVisit> oaReturnVisits) {
		this.oaReturnVisits = oaReturnVisits;
	}

}